package cn.cvs.service;

import cn.cvs.dao.SysUserMapper;
import cn.cvs.pojo.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysUserServlceImpl implements SysUserServlce {
    @Autowired
    public SysUserMapper sysUserMapper;



    @Override
    public SysUser login(String account, String password) {

        SysUser sysUser = sysUserMapper.findByAccount(account);
        System.out.println(sysUser);

        if (sysUser == null){
            return null;
        }
        return sysUser;
    }

    @Override
    public List<SysUser> list(String realName,Integer roleId,Integer startIndex,Integer pageSize) {

        List<SysUser> list = sysUserMapper.list(realName,roleId,startIndex,pageSize);

        return list;
    }

//    @Override
//    public int count(String realName, Integer roleId) {
//        return sysUserMapper.count(realName,roleId);
//    }
}
